//2009/08/17 01:32:13
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class OneMoreRectangle
{
public:
    int maxCover(vector <string> rec, int qa, int qb)
    {
        int r[51][4] = {0};
        int ret = 0;
        for (int i=0; i<rec.size(); i++)
        {
            stringstream s(rec[i]);
            s >> r[i][0] >> r[i][1] >> r[i][2] >> r[i][3];
        }
        for (int i=0; i<rec.size(); i++) // From any x-level point.
        {
            for (int j=0; j<rec.size(); j++) // From any y-level point.
            {
                int c1 = 0, c2 = 0;
                for (int k = 0; k<rec.size(); k++) // To test the window fit in both directions.
                {
                    if (r[i][0]<=r[k][0] && r[j][1]<=r[k][1] &&
                            r[i][0]+qa>=r[k][2] && r[j][1]+qb>=r[k][3]) c1++;
                    if (r[i][0]<=r[k][0] && r[j][1]<=r[k][1] &&
                            r[i][0]+qb>=r[k][2] && r[j][1]+qa>=r[k][3]) c2++;

                }
                ret = max(ret, max(c1,c2));
            }
        }
		return ret;
    }
};
